<!-- 通用CSS -->
<head th:fragment=header(title)>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta name="keywords" content="${title}" />
	<meta name="description" content="${title}" />
	<title th:text="${title}"></title>
	<link th:href="@{/favicon.ico}" rel="shortcut icon"/>
	<link th:href="@{/css/com.css}" rel="stylesheet"/>
	<link th:href="@{/css/home.css}" rel="stylesheet"/>
	<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
	<link rel="stylesheet" th:href="@{/css/ui-select.css}" />
</head>
<div th:fragment="menu">

	<style>
		.footer {
			margin-top: 0;
		}

		.webuploader-element-invisible {
			position: absolute !important;
			clip: rect(1px 1px 1px 1px);
			/* IE6, IE7 */
			clip: rect(1px, 1px, 1px, 1px);
		}

		.webuploader-pick {
			position: relative;
			width: 100px;
			height: 100px;
			line-height: 50px;
			padding-left: 0px;
			margin: 0;
			font-size: 16px;
			color: #fff;
			background: #fff;
			text-align: left;
			border-radius: 5px;
			-moz-transition: all 1s ease;
			-webkit-transition: all 1s ease;
			transition: all 1s ease;
		}

		.webuploader-pick span {
			position: absolute;
			display: none;
			height: 100px;
			line-height: 100px;
			width: 100px;
			left: 0;
			top: 0;
			text-align: center;
			background: #000;
			filter: Alpha(opacity=60);
			background-color: rgba(0, 0, 0, 0.6);
		}
	</style>
	<div class="user_photo" title="点击修改头像">
		<img th:src="${sysmember.photo!=null} ? ${sysmember.photo} : @{/img/photo.png}" />
		<span>上传中...</span>
	</div>
	<div class="user_name">
		<p th:text="${sysmember.nickname}"></p>
		<!--<a href="center/group.html">【<?php echo $ugroup->groupname ?>】</a>-->
	</div>
	<div class="user_vip">
		<i></i>
		<a href="/user/vip" th:text="${sysmember.vipdate}?${#dates.format(sysmember.vipdate, 'yyyy-MM-dd')+'到期'}:'开通vip'">
		</a>
	</div>
	<div class="center_menu">
		<ul>
			<li><a th:classappend="${url=='/user/center'}?'active'" href="/user/center"><i class="fa fa-book fa-lg"></i>我的文档<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a th:classappend="${url=='/user/income'}?'active'" href="/user/income"><i class="fa fa-cny fa-lg"></i>我的收益<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a th:classappend="${url=='/user/purchase'}?'active'"  href="/user/purchase"><i class="fa fa-cny fa-lg"></i>我的支出<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a th:classappend="${url=='/user/down'}?'active'"  href="/user/down"><i class="fa fa-download fa-lg"></i>我的下载<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a th:classappend="${url=='/user/favorite'}?'active'"  href="/user/favorite"><i class="fa fa-bookmark-o fa-lg"></i>我的收藏<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a th:classappend="${url=='/user/topic'}?'active'"  href="/user/topic"><i class="fa fa-suitcase fa-lg"></i>我的专题<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<!--<li><a class="<?php if ($this->router->method == 'reward') echo 'active' ?>" href="center/reward.html"><i class="fa fa-diamond fa-lg"></i>我的悬赏<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a class="<?php if ($this->router->method == 'article') echo 'active' ?>" href="center/article.html"><i class="fa fa-pencil fa-lg"></i>我的文章<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a class="<?php if ($this->router->method == 'ask') echo 'active' ?>" href="center/ask.html"><i class="fa fa-wpforms fa-lg"></i>我的问题<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a class="<?php if ($this->router->method == 'message') echo 'active' ?>" href="center/message.html"><i class="fa fa-commenting-o fa-lg"></i>我的消息<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>-->
			<li><a th:classappend="${url=='/user/order'}?'active'" href="/user/order"><i class="fa fa-opencart fa-lg"></i>我的订单<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<!--<li><a class="<?php if ($this->router->method == 'task') echo 'active' ?>" href="center/task.html"><i class="fa fa-tasks fa-lg"></i>我的任务<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>-->
			<li><a th:classappend="${url=='/user/group'}?'active'" href="/user/group"><i class="fa fa-group fa-lg"></i>我用户组<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<!--<li><a class="<?php if ($this->router->method == 'auth') echo 'active' ?>" href="center/auth.html"><i class="fa fa-id-card-o fa-lg"></i>我的认证<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>-->
			<li><a th:classappend="${url=='/user/account'}?'active'" href="/user/account"><i class="fa fa-user-o fa-lg"></i>我的账号<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
			<li><a  href="/logout"><i class="fa fa-sign-out fa-lg"></i>退出账号<i class="fa fa-angle-right" aria-hidden="true"></i></a></li>
		</ul>
	</div>
	<script th:src="@{/js/jquery-1.12.4.min.js}"></script>
	<script th:src="@{/js/webuploader.js}"></script>
	<script>
		var uploader = WebUploader.create({
			swf: '/js/Uploader.swf',
			server: '/common/upload/logo',
			pick: '.user_photo',
			accept: {
				title: '头像',
				extensions: 'gif,jpg,jpeg,bmp,png',
				mimeTypes: 'image/*'
			},
			auto: true,
			compress: {
				width: 100,
				height: 100,
				quality: 100,
				allowMagnify: false,
				crop: true,
				preserveHeaders: true
			},
			thumb: {
				width: 100,
				height: 100,
				allowMagnify: false,
				crop: false,
			}
		});

		uploader.on('fileQueued', function(file) {

		});

		uploader.on('uploadProgress', function(file, percent) {
			$(".webuploader-pick span").show();
		});

		uploader.on('uploadError', function(file, reason) {
			Message("头像" + file.name + "上传失败，原因：" + reason);
		});

		uploader.on('uploadSuccess', function(file, response) {
			if(response.code==401) {
				Message(response.msg,response.msg,function name()
				{window.location.href="/login";});

			}
			ShowTip(response.msg,false);

		});
		uploader.on('uploadFinished', function() {
			$(".user_photo img").attr("src", $(".user_photo img").attr("src") + '?' + Math.random());
			$(".webuploader-pick span").hide();
		});
	</script>

</div>
<div th:fragment="menuheader">

	<div class="center_header">
		<h4>我的资产</h4>
		<ul class="center_docsum">
			<li><p th:text="${doccount}"></p><span>文档数</span></li>
			<li><p th:text="${readcount}"></p><span>浏览量</span></li>
			<li><p th:text="${downcount}"></p><span>下载量</span></li>
		</ul>
		<ul class="center_glod">
			<li>
				<p th:text="${sysmember.glods}"></p><span>余额(<span th:text="${systradesets.glodname}" th:remove="tag"></span>)</span>
				<a href="/user/glodpay">充值</a>
			</li>

			<li th:if="${iscoin}">
				<p><span th:text="${ugroup.divide*100}" th:remove="tag"></span> %</p><span>提现利率</span>
				<a href="/user/cash">立即提现</a>
			</li>
			<li>
				<p th:text="${sysmember.points}"></p><span>积分</span>
				<a href="/user/change">积分兑换</a>
			</li>
		</ul>
		<div class="center_income">
			<span>昨天收益：</span><span th:text="|${systradesets.glodname}${yesterday}${systradesets.glodunit}|" th:remove="tag"></span>
		</div>
	</div>

</div>
<div th:fragment="top">
	<div class="right_bar">
		<ul>
			<!--<li class="bar-1"><a href="https://wpa.qq.com/msgrd?v=3&uin=50245077&site=http://www.ds32.com&menu=yes" rel="nofollow"></a></li>
            <li class="bar-2"><a href="javascript:;"></a>
                <div class="app_down">
                    <p>安装APP,随时看</p>
                    <img src="data/img/eewm.png">
                </div>
            </li> -->
			<li class="bar-3"><a href="javascript:;"></a></li>
		</ul>
	</div>
	<div class="top">
		<div class="iw">
			<p>您好，欢迎访问世弘文库系统</p>
			<ul>
			</ul>
		</div>
	</div>
	<div class="header">
		<div class="head_a iw">
			<a class="logo" href="/"><img th:src="@{/img/logo.png}" alt="世弘文库系统"/></a>
			<div class="search">
				<div class="search_text">
					<div class="select">文档</div>
					<i></i>
					<ul class="dropdown">
						<li data-id="home">文档</li>
						<li data-id="topic">专题</li>
						<!--<li data-id="reward">悬赏</li>
						<li data-id="article">文章</li>
						<li data-id="ask">问答</li>-->
					</ul>
					<input id="txt_search" type="text" placeholder="请输入您要搜索的内容..." th:value="${key}" />
				</div>
				<a id="search_button"><i class="fa fa-search fa-lg"></i></a>

			</div>
			<a class="upload" href="/uploaddoc"><i></i>上传文档</a>
		</div>
		<div class="head_b iw">
			<div class="nav home">
				<!--<div th:text="${type_array}"></div>-->
				<p><a href="javascript:;" goto=""><i class="fa fa-bars fa-lg" aria-hidden="true"></i>文档分类</a></p>

				<ul class="nav_list">

					<div th:each="entry :${type_array}" th:if="${entry.key} == 0 " th:remove="tag" >
					<li th:each="item : ${entry.value}">

						<h2><a th:href="@{/doc.html(first=${item.typeid})}"><span th:text="${item.typename}" th:remove="tag"></span><i class="fa fa-angle-right" aria-hidden="true"></i></a></h2>
						<div class="nav_extend">
							<div  th:if="${type_array[item.typeid]}" th:remove="tag" >
								<div th:each="entry1 :${type_array[item.typeid]}" class="nav_second">
									<h2>
										<a th:href="@{/doc.html(first=${entry1.typeid})}" th:text="${entry1.typename}"></a>
									</h2>

									<div  th:if="${type_array[entry1.typeid]}" th:remove="tag" >
									<span>

                                        <h2 th:each="entry2 : ${type_array[entry1.typeid]}">
											<a th:text="${entry2.typename}" th:href="@{/doc.html(first=${entry2.typeid})}"></a>
										</h2>

                                	</span>
								</div>

							</div>
						</div>

					</li>

					</div>

				</ul>
			</div>
			<!--<div class="nav down">
				<p><a href="javascript:;" goto="doc.html"><i class="fa fa-bars fa-lg" aria-hidden="true"></i>文档分类</a></p>
			</div>-->

			<ul class="nav_bar">
				<li><a th:classappend="${navurl=='/'}?'active'" href="/" target="_self" >首页</a></li>
				<li><a th:classappend="${navurl=='/doc.html'}?'active'" href="/doc.html" target="_self" >文档</a></li>
				<li><a th:classappend="${navurl=='/topic.html'}?'active'"  href="/topic.html" target="_self" >专题</a></li>
				<li><a th:classappend="${navurl=='/vip.html'}?'active'" href="/vip.html?first=0&second=0-0-0&third=4" target="_self" >VIP文档</a></li>
				<!--<li><a class="" href="reward.html" target="_self" >悬赏</a></li>
				<li><a class="" href="article.html" target="_self" >文章</a></li>
				<li><a class="" href="ask.html" target="_self" >问答</a></li>
				<li><a class="" href="help.html" target="_self" >帮助</a></li>-->
			</ul>
		</div>
	</div>

</div>
<div th:fragment="footer">
	<div class="footer">
		<div class="iw">
			<!--<div class="footer_a">
                <img src="template/default/pc/static/img/logo_b.png">
                <div><img src="data/img/eewm.png"><span>扫描二维码<br>关注官方微信</span></div>
            </div>-->

			<div class="footer_b">
				<ul>
					<li th:each="entry :${about}">
						<p th:text="${entry.key}"></p>

						<a th:each="item : ${entry.value}" th:text="${item.title}" th:href="@{/help.htm(id=${item.id})}"></a>

					</li>
				</ul>
			</div>
			<div class="footer_c">
				<p>联系我们</p>
				<ul>
					<li>
						<p>电话 : <span th:text="${site.name}" th:remove="tag"></span></p>
						<p>邮箱 : <span th:text="${site.email}" th:remove="tag"></span></p>
						<p>Q Q : <span th:text="${site.qq}" th:remove="tag"></span> </p>
						<p>地址 : <span th:text="${site.address}" th:remove="tag"></span> </p>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<div class="zub">
		<div class="iw">

			<span><div th:text="${site.name}" th:remove="tag"></div>All Rights Reserved.
            <a href='https://beian.miit.gov.cn' target="_blank" rel="nofollow" th:text="${site.icp}" ></a>
        </span>
		</div>
	</div>
	<div class="ui-modal-cover"></div>
	<div class="ui-modal animated">
		<div class="ui-modal-header ui-move">
			<div class="ui-modal-title"></div><i>&times;</i>
		</div>
		<div class="ui-modal-body"></div>
		<div class="ui-modal-footer">
			<span class="ui-btn">取消</span><a class="ui-btn ui-btn-blue" modal>确定</a>
		</div>
	</div>
	<div class="ui-tip animated">保存成功</div>
	<div class="html"></div>
	<script th:inline="javascript"> var ctx = [[@{/}]];</script>
	<script th:src="@{/js/jquery-1.12.4.min.js}"></script>
	<script th:src="@{/js/com.js?v2.6}"></script>
	<script>
		$.get("/header_cache", function (data) {
			$(".top ul").html(data);
		});

		//right_bar
		$(".right_bar .bar-3").click(function () {
			$('html,body').animate({
				scrollTop: 10
			}, 200);
			return false;
		});

		$(".right_bar .bar-2").mouseenter(function () {
			$(".right_bar .app_down").show();
		}).mouseleave(function () {
			setTimeout(function () {
				$(".right_bar .app_down").fadeOut();
			}, 300);
		});

		//搜索
		$(function () {
			$(".search_text .select,.search_text i").click(function () {
				$(".search_text .dropdown").show();
				return false;
			});

			var search_url = "lists";
			if (search_url == "topic" || search_url == "reward" || search_url == "article" || search_url == "ask")
				$(".search_text .select").text($(".search_text .dropdown [data-id='" + search_url + "']").text());

			$(".search_text .dropdown li").click(function () {
				$this = $(this);
				$(".search_text .select").text($this.text());
				$(".search_text .dropdown").hide();
				search_url = $this.attr("data-id");
				return false;
			});

			$("#search_button").click(function () {
				if (search_url == "topic") {
					$(".search_text .select").text('专题');
					location.href = "/topic.html?key=" + $("#txt_search").val();
				} else if (search_url == "reward") {
					$(".search_text .select").text('悬赏');
					location.href = "/<?php echo $seo->rewl ?>0-0-1-1-" + $("#txt_search").val() + ".html";
				} else if (search_url == "article") {
					$(".search_text .select").text('文章');
					location.href = "/<?php echo $seo->artl ?>0-1-1-" + $("#txt_search").val() + ".html";
				} else if (search_url == "ask") {
					$(".search_text .select").text('问答');
					location.href = "/<?php echo $seo->askl ?>0-1-1-" + $("#txt_search").val() + ".html";
				} else {
					location.href = "/search.htm?key=" + $("#txt_search").val();
				}
			});

			$(document).delegate("body", "click", function () {
				$(".search_text .dropdown").hide();
			});
		});

		//首页分类
		$('.nav_list li').hover(function () {
			$(".nav_list > li > div ").css('display', 'none');
			$(this).children("div").show();
		}, function () {
			$(".nav_list > li > div ").css('display', 'none');
		});

		//分类下拉
		$(function () {
			$(".nav.down > p").click(function () {
				$(".nav.down > ul").stop().slideToggle("slow");
			});
		});

		$(document).on("keydown", function (e) {
			if (e.keyCode == 13 && $("#txt_search").is(":focus")) {
				$("#search_button").click();
			}
		});
	</script>
	</body>


</div>
